<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>课程设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header"><i class="fa fa-cog"></i> 课程设置</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form form-label-w8" lay-filter="">
						<div class="layui-form-item">
							<label class="layui-form-label">详情页推荐：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[details_rec]" value="1" {if $info['details_rec']==1}checked{/if} title="开启"/>
								<input type="radio" name="info[details_rec]" value="0" {if $info['details_rec']==0}checked{/if} title="关闭"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启详情页显示为您推荐</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">是否显示学习人数：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[show_join_num]" value="1" {if $info['show_join_num']==1}checked{/if} title="显示"/>
								<input type="radio" name="info[show_join_num]" value="0" {if $info['show_join_num']==0}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">列表页和详情页是否显示学习人数</div>
						</div>
<!--						<div class="layui-form-item">-->
<!--							<label class="layui-form-label">已购课程价格显示：</label>-->
<!--							<div class="layui-input-inline">-->
<!--								<input type="radio" name="info[show_buyed_kecheng_price]" value="1" {if $info['show_buyed_kecheng_price']==1}checked{/if} title="价格"/>-->
<!--								<input type="radio" name="info[show_buyed_kecheng_price]" value="0" {if $info['show_buyed_kecheng_price']==0}checked{/if} title="已购买"/>-->
<!--							</div>-->
<!--							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">列表页和详情页已购课程显示价格还是已购买</div>-->
<!--						</div>-->

					<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
						<legend>详情页显示</legend>
					</fieldset>
						<div class="layui-form-item">
							<label class="layui-form-label">是否显示{:t('佣金')}：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[showcommission]" value="1" {if $info['showcommission']==1}checked{/if} title="显示"/>
								<input type="radio" name="info[showcommission]" value="0" {if $info['showcommission']==0}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后商品详情页显示分销{:t('佣金')}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否显示升级优惠：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[show_lvupsavemoney]" value="1" {if $info['show_lvupsavemoney']==1}checked{/if} title="显示"/>
								<input type="radio" name="info[show_lvupsavemoney]" value="0" {if $info['show_lvupsavemoney']==0}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">商品详情页是否显示升级到下一级可节省多少元</div>
						</div>
					
				     <div class="layui-form-item">
							<label class="layui-form-label">升级优惠文字：</label>
							<div class="layui-input-inline" style="width:400px">
								<input type="text" name="info[upgrade_text]" class="layui-input" value="{$info['upgrade_text']}" placeholder="升级到[等级名称]预计可省[优惠金额]元">
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">[等级名称],[优惠金额]可自动替换</div>
						</div>


						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-block">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
	layui.form.on('radio(cancodset)', function(data){
		if(data.value == '1'){
			$('#cancodset').show();
		}else{
			$('#cancodset').hide();
		}
	})
	layui.form.on('radio(freightfree)', function(data){
		if(data.value == '1'){
			$('#freightfreemoneyset').show();
		}else{
			$('#freightfreemoneyset').hide();
		}
	})

	layui.form.on('radio(comment)', function(data){
		if(data.value == '1'){
			$('#commentset').show();
		}else{
			$('#commentset').hide();
		}
	})
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
    console.log(field);
		$.post("{:url('save')}",field,function(data){
			dialog(data.msg,data.status,data.url);
		})
	})
  </script>
	{include file="public/copyright"/}
</body>
</html>